<?php
/* Pitch Test cases generated on: 2010-11-16 11:11:43 : 1289902903*/
App::import('Model', 'Pitch');

class PitchTestCase extends CakeTestCase {
	var $fixtures = array('app.message', 'app.user', 'app.group', 'app.contractor_profile', 'app.designer_profile', 'app.comment', 'app.design', 'app.pitch', 'app.pitch_subscription', 'app.design_photo', 'app.job');

	function startTest() {
		$this->Pitch =& ClassRegistry::init('Pitch');
		$_SESSION['Auth']['User']['id'] = 8;
		$_SESSION['Auth']['User']['group_id'] = 1;
	}

	function endTest() {
		unset($this->Pitch);
		ClassRegistry::flush();
		unset($_SESSION['Auth']['User']);
	}
	
	function testGetRandom() {
		$result = $this->Pitch->get_random();
		$result = count($result);
		$expected = 5;
		$this->assertEqual($result, $expected);
	}
	
	function testGetPitches() {
		$result = count($this->Pitch->get_pitches());
		$expected = 6;
		$this->assertEqual($result, $expected);
		
		$_SESSION['Auth']['User']['id'] = 2;
		$_SESSION['Auth']['User']['group_id'] = 2;
		$result = count($this->Pitch->get_pitches());
		$expected = 2;
		$this->assertEqual($result, $expected);
	}
	
	function testGetPitch() {
		$result = count($this->Pitch->get_pitch(1));
		$expected = 5;
		$this->assertEqual($result, $expected);
		
		$result = $this->Pitch->get_pitch();
		$this->assertFalse($result);
	}

}
?>
